package com.cskaoyan.day6;

import java.util.Arrays;

public class ArraySort {
    public static void main(String[] args) {
        int[] arr = {100,213123,23,45,88,0,-123,213,10,90};
        System.out.println(Arrays.toString(arr));
        for(int i=0;i<arr.length;i++){
            for (int j = 0; j < arr.length-i-1; j++) {
                if(arr[j]>arr[j+1]){
                    swap(arr,j,j+1);
                }
            }
        }
        System.out.println(Arrays.toString(arr));
    }

    private static void swap(int[] arr ,int i ,int j) {
        int temp=arr[i];
        arr[i]=arr[j];
        arr[j]=temp;
    }
}
